/*
 *  EidoTronApp.cpp
 *  EidoTron
 *
 *  Created by Luca Di Franco on 07/03/11.
 *  Copyright 2011 Luca Di Franco. All rights reserved.
 *
 */

#include "EidoTronApp.h"

#include "../Utilities/Timer.h"


EidoTronApp::EidoTronApp()
{
	running = true;
	pause = false;
	displaySurface = NULL;
}

EidoTronApp::~EidoTronApp()
{ }

int EidoTronApp::execute()
{
	SDL_Event event;
	if (!setupWindow())
		return EXIT_FAILURE;
	initScene();
	while (running)
	{
		Timer::lap();
		while (SDL_PollEvent(&event))
			menuEventListener(&event);
		if (!pause)
		{
			gameEventListener();
			loop();
			render();
		}
	}
	cleanup();
	return EXIT_SUCCESS;
}